
from google.appengine.ext import db

class DamageModel(db.Model):
    structure = db.IntegerProperty()
    crippled = db.IntegerProperty()
    weapon = db.IntegerProperty()
    movement = db.IntegerProperty()
    electronic = db.IntegerProperty()

def getDamageModelKey(structure=None, crippled=None, weapon=None, movement=None, electronic=None):
    key_name = ""
    if (weapon or movement or electronic):
        # Complex damage
        key_name = "c_%s_%s_%s" % (weapon, movement, electronic)
    else:
        # Simple Damage
        key_name = "s_%s_%s" % (structure, crippled)
    return key_name
